package com.china08.yxyapi.repository.db;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.china08.yxyapi.entity.db.sws.SwsSection;

public interface SwsSectionRepository extends JpaRepository<SwsSection, String> {

    SwsSection findById(String id);

    List<SwsSection> findBySchoolIdAndIsVisibleAndShowNavigationAndPidOrderByOrderNumAsc(String schoolId,
            Boolean isVisible, Boolean showNavigation, String pid);

    List<SwsSection> findBySchoolIdAndIsVisibleAndIsOutLinkAndShowInHomePageAndPidOrderByOrderNumAsc(String schoolId,
            Boolean isVisible, Boolean isOutLink, Boolean showInHomePage, String pid);

    List<SwsSection> findBySchoolIdAndPidOrderByOrderNumAsc(String schoolId, String pid);

    List<SwsSection> findBySchoolIdAndPidAndSectionTypeOrderByOrderNumAsc(String schoolId, String pid,
            Integer sectionType);

    List<SwsSection> findBySchoolIdAndSectionName(String schoolId, String sectionName);

    List<SwsSection> findBySchoolId(String schoolId);

    // 获取orderNun最大的那个
    SwsSection findTop1BySchoolIdAndPidOrderByOrderNumDesc(String schoolId, String pid);

    Integer countBySchoolIdAndPid(String schoolid, String pid);

    SwsSection findBySchoolIdAndId(String schoolId, String section2Id);

    List<SwsSection> findByPid(String string);

    // 查询是否为外链行栏目.
    List<SwsSection> findByIsOutLinkOrderByOrderNumAsc(boolean b);

    List<SwsSection> findByIsOutLinkAndShowNavigationForMicroWebSiteAndSchoolIdAndIsVisibleAndPidOrderByOrderNumAsc(
            boolean b, boolean c, String schoolId, boolean isVisible, String pid);

}
